package com.ss.android.article.base.feature.detail2.video.a;

import android.content.Intent;
import android.view.View;
import com.ss.android.article.base.feature.detail.model.ArticleInfo;
import com.ss.android.article.base.feature.detail2.view.NewDetailActivity;
import com.ss.android.common.lib.MobClickCombiner;
import com.ss.android.newmedia.a.AdsAppBaseActivity;
import com.ss.android.newmedia.util.AppUtil;

final class n implements View.OnClickListener {
    private final l b;
    private final ArticleInfo a;

    n(l arg1, ArticleInfo arg2) {
        this.b = arg1;
        this.a = arg2;

    }

    public final void onClick(View arg14) {
        if(this.a != null) {
            l v0 = this.b;
            long v2 = this.a.relatedVideoGroupId;
            long v4 = this.a.relatedVideoItemId;
            int v1 = this.a.relatedVideoAggrType;
            long v6 = this.a.itemId;
            String v8 = this.a.relatedVideoOpenPageUrl;
            String v9 = this.a.relatedVideoOuterSchema;
            if(v2 <= 0) {
                return;
            }

            if(v6 <= 0) {
                return;
            }

            try {
                MobClickCombiner.onEvent(v0.g, "detail", "click_large_video");
                if(!android.support.design.a.isTextEmpty(v9) && (AppUtil.b(v0.g, "com.youku.phone", v9))) {
                    AppUtil.b(v0.g, v9);
                    MobClickCombiner.onEvent(v0.g, "detail", "enter_youku");
                    return;
                }

                if(!android.support.design.a.isTextEmpty(v8)) {
                    AppUtil.b(v0.g, AdsAppBaseActivity.b(v8));
                    return;
                }

                Intent v8_1 = new Intent(v0.g, NewDetailActivity.class);
                v8_1.putExtra("view_single_id", true);
                v8_1.putExtra("group_id", v2);
                v8_1.putExtra("item_id", v4);
                v8_1.putExtra("aggr_type", v1);
                v8_1.putExtra("detail_source", "click_related");
                if(v6 > 0) {
                    v8_1.putExtra("from_gid", v6);
                }

                v0.g.startActivity(v8_1);
            }
            catch(Throwable v0_1) {
                v0_1.printStackTrace();
            }
        }
    }
}

